package com.tianji.learning.service;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.domain.dto.LearningPlanDTO;
import com.tianji.learning.domain.po.LearningLesson;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.learning.domain.vo.LearningLessonVO;
import com.tianji.learning.domain.vo.LearningPlanPageVO;

import java.util.List;

/**
 * <p>
 * 学生课程表 服务类
 * </p>
 *
 * @author xioayang
 * @since 2024-06-20
 */
public interface ILearningLessonService extends IService<LearningLesson> {

    /**
     * 添加用户课程
     * @param userId
     * @param courseIds
     */
    void addUserLessons(Long userId, List<Long> courseIds);

    /**
     * 分页查询我的课程
     * @param pageQuery
     * @return
     */
    PageDTO<LearningLessonVO> queryLearningLessonPage(PageQuery pageQuery);

    /**
     * 查询正在学习的课程
     * @return
     */
    LearningLessonVO queryLearningLesson();

    /**
     * 删除课程
     * @param courseId
     */
    void deleteCourseFromLesson(Long userId,Long courseId);

    /**
     * 查询课程是否在课程表中
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     * 根据课程id查询课程
     * @param courseId
     * @return
     */
    LearningLessonVO queryLearningLessonByCourseId(Long courseId);

    /**
     * 统计课程学习人数
     * @param courseId
     * @return
     */
    Integer countLearningLessonByCourse(Long courseId);

    /**
     * 根据用户id和课程id查询课程
     * @param userId
     * @param courseId
     * @return
     */
    public LearningLesson queryByUserAndCourseId(Long userId, Long courseId);

    /**
     * 创建学习计划
     * @param
     * @param
     */
    void createLearningPlan(LearningPlanDTO planDTO);

    /**
     * 查询我的学习计划
     * @param query
     * @return
     */
    LearningPlanPageVO queryMyPlans(PageQuery query);
}

